<?php

//$http_method = strtoupper($_SERVER['REQUEST_METHOD']);

$url = urldecode(get_input('url', ''));
$start = intval(get_input('start', 0));
$limit = intval(get_input('limit', 5));

if ($url === '') {
    echo json_encode(array("status" => 500, "message" => "url can not be empty!"));
    exit;
}
$data = GgsSocialObjects::getComments($url,$start, $limit);
$data['url'] = $url;
$data['next_index'] = $start + $limit;
echo json_encode(array("status" => 200, "data" => $data));